<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/locale/easyui-lang-zh_CN.js"></script>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/gray/easyui.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
	<script type="text/javascript" src="__PUBLIC__/js/add-tab.js"></script>
	<link rel="stylesheet" href="__PUBLIC__/css/common.css" />
	<link rel="stylesheet" href="__PUBLIC__/js/kindeditor/themes/default/default.css" />
    <script src="__PUBLIC__/js/kindeditor/kindeditor-min.js"></script>
    <script src="__PUBLIC__/js/kindeditor/lang/zh_CN.js"></script>

	<script type="text/javascript">


	$.extend($.fn.validatebox.defaults.rules, {
	    
	    mobile: {
        validator: function (value) {
            var reg = /^1[3|4|5|8|9]\d{9}$/;
            return reg.test(value);
        },
        message: '输入手机号码格式不准确.'
       },
	    
	    QQ:{
	        validator: function (value, param) {
	            return /^[1-9]\d{4,10}$/.test(value);
	        },
	        message: 'QQ号码不正确'
	    },
	    equalTo: {
			validator: function (value, param) {
			return value== $(param[0]).val();
			},
			message: '两次输入的字符不一至'
		},
		idcard : {
	        validator : function(value) {
	            return /^\d{15}(\d{2}[A-Za-z0-9])?$/i.test(value);
	        },
	        message : '身份证号码格式不正确'
	    },
	    phone : {
        validator : function(value) {
            return /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i.test(value);
        },
        message : '格式不正确,请使用下面格式:020-88888888'
    	},
    	integer : {
        validator : function(value) {
            return /^[+]?[0-9]+\d*$/i.test(value);
        },
        message : '请输入数字'
    	},
    	name: {
        validator: function(value){  
                var flag;
                    $.ajax({
                            type: 'POST', 
                            url: '__URL__/check_employe_work_id',
                            data:{employe_work_id:value},
                            async:false,
                            success: function(data) {
                                if(data=='ok') {
                                    flag = true;
                                }else{
                                    flag = false;
                                }
                            }
                     });
                  return flag;
            },
           message: '用户名已存在，请更换！'
        }
	});

	$(function(){
		$('#addemployefrm').form({
			url:'__URL__/editEmployePost',
		    onSubmit:function(){
		        return $(this).form('validate');
		    },
		    success:function(data){
		    	if(data=='ok'){
		    		$.messager.alert('提醒', '保存成功!', 'info');
		    	}
		    	if(data=='no'){
		    		$.messager.alert('提醒','您还没有修改!','info');
		    	}
		        
		    }

		});
	})



	$(function(){
	  $('#uiform input').each(function () {
	            if ($(this).attr('required') || $(this).attr('validType'))
	                $(this).validatebox();
	        })
	});

		
	</script>

	<script>
        KindEditor.ready(function(K) {
            var editor = K.editor({
                allowFileManager : true
            });
            K('#image3').click(function() {
                editor.loadPlugin('image', function() {
                    editor.plugin.imageDialog({
                        showRemote : false,
                        imageUrl : K('#url3').val(),
                        clickFn : function(url, title, width, height, border, align) {
                            K('#url3').val(url);
                            K('.photo').attr("src",url);
                            editor.hideDialog();
                        }
                    });
                });
            });
        });

        KindEditor.ready(function(K) {
	      var editor = K.editor({
	        allowFileManager : false

	      });
	      K('#insertfile').click(function() {
	        editor.loadPlugin('insertfile', function() {
	          editor.plugin.fileDialog({
	            fileUrl : K('#url').val(),
	            clickFn : function(url, title) {
	              K('#url').val(url);
	              editor.hideDialog();
	            }
	          });
	        });
	      });
	    });
    </script>
    <script type="text/javascript">

		$(function(){
			<volist name="employeData" id="vo">
			$(".employe_role").find("option[value='{$vo.employe_role}']").replaceWith("<option value='{$vo.employe_role}' selected><eq name='vo.employe_role' value='3'>普通用户</eq><eq name='vo.employe_role' value='1'>系统管理员</eq><eq name='vo.employe_role' value='2'>高层管理者</eq></option>");

			$(".employe_sex").find("option[value='{$vo.employe_sex}']").replaceWith("<option value='{$vo.employe_sex}' selected><eq name='vo.employe_sex' value='男'>男</eq><eq name='vo.employe_sex' value='女'>女</eq></option>");

			$(".employe_if_marray").find("option[value='{$vo.employe_if_marray}']").replaceWith("<option value='{$vo.employe_if_marray}' selected><eq name='vo.employe_if_marray' value=''>--婚姻状况--</eq><eq name='vo.employe_if_marray' value='未婚'>未婚</eq><eq name='vo.employe_if_marray' value='已婚'>已婚</eq><eq name='vo.employe_if_marray' value='离异'>离异</eq><eq name='vo.employe_if_marray' value='丧偶'>丧偶</eq></option>");

			$(".employe_politics").find("option[value='{$vo.employe_politics}']").replaceWith("<option value='{$vo.employe_politics}' selected><eq name='vo.employe_politics' value=''>--政治面貌--</eq><eq name='vo.employe_politics' value='共青团员'>共青团员</eq><eq name='vo.employe_politics' value='预备党员'>预备党员</eq><eq name='vo.employe_politics' value='党员'>党员</eq><eq name='vo.employe_politics' value='民主党派'>民主党派</eq><eq name='vo.employe_politics' value='群众'>群众</eq></option>");

			$(".employe_account_type").find("option[value='{$vo.employe_account_type}']").replaceWith("<option value='{$vo.employe_account_type}' selected><eq name='vo.employe_account_type' value=''>--户口类别--</eq><eq name='vo.employe_account_type' value='本地城镇居民'>本地城镇居民</eq><eq name='vo.employe_account_type' value='外埠城镇居民'>外埠城镇居民</eq><eq name='vo.employe_account_type' value='本地农村户口'>本地农村户口</eq><eq name='vo.employe_account_type' value='外地农村户口'>外地农村户口</eq></option>");

			$(".employe_work_state").find("option[value='{$vo.employe_work_state}']").replaceWith("<option value='{$vo.employe_work_state}' selected><eq name='vo.employe_work_state' value=''>--在职状态--</eq><eq name='vo.employe_work_state' value='在职'>在职</eq><eq name='vo.employe_work_state' value='离职'>离职</eq><eq name='vo.employe_work_state' value='离休'>离休</eq><eq name='vo.employe_work_state' value='退休'>退休</eq><eq name='vo.employe_work_state' value='借调'>借调</eq></option>");

			$(".employe_degree").find("option[value='{$vo.employe_degree}']").replaceWith("<option value='{$vo.employe_degree}' selected><eq name='vo.employe_degree' value=''>--学历--</eq><eq name='vo.employe_degree' value='小学'>小学</eq><eq name='vo.employe_degree' value='初中'>初中</eq><eq name='vo.employe_degree' value='中专'>中专</eq><eq name='vo.employe_degree' value='高中'>高中</eq><eq name='vo.employe_degree' value='大专'>大专</eq><eq name='vo.employe_degree' value='本科'>本科</eq><eq name='vo.employe_degree' value='硕士'>硕士</eq><eq name='vo.employe_degree' value='博士'>博士</eq></option>");
			</volist>
		})
	</script>
</head>
<body>
<form id="addemployefrm" method="post">
<volist name="employeData" id="vo">
<input type="hidden" name="employe_id" value="{$vo.employe_id}"/>
<div id="uiform">
	<table>
		<tr>
			<td colspan="6" style="text-align: center;font-family: '黑体';">基本信息</td>
		</tr>
		<tr>
			<td>工号（登录名）：</td>
			<td><input class="employe_work_id easyui-validatebox" name="employe_work_id" type="text" data-options="validType:['name','integer','length[0,8]'],required:true" value="{$vo.employe_work_id}" disabled="disabled"/>&nbsp;*</td>
			<td>登录密码：</td>
			<td><input class="employe_password easyui-validatebox" type="password" data-options="validType:['length[6,30]'],required:true" value="******" readonly="readonly" />&nbsp;*</td>
			
			<td align="center" rowspan="6"><img class="photo" style="width: 200px; " src="{$vo.employe_photo}"></td>
		</tr>

		<tr>
			<td>角色：</td>
			<td>
				<select name="employe_role" class="employe_role">
					<volist name="roleData" id="vo">
						<option value="{$vo.role_id}">{$vo.role_name}</option>
					</volist>
				</select>&nbsp;*
			</td>
			<td>确认密码：</td>
			<td><input class="employe_password_true easyui-validatebox" type="password" validType="equalTo['.employe_password']" data-options="required:true" value="******" readonly="readonly"/>&nbsp;*</td>

		</tr>

		<tr>
			<td>姓名：</td>
			<td><input class="employe_name easyui-validatebox" name="employe_name" type="text" data-options="validType:['length[0,20]']" value="{$vo.employe_name}"/></td>
			<td>性别：</td>
			<td>
				<select class="employe_sex" name="employe_sex">
					<option value="男">男</option>
					<option value="女">女</option>
				</select>
			</td>
		</tr>

		<tr>
			
			<td>身份证号：</td>
			<td><input class="employe_identity_card easyui-validatebox" name="employe_identity_card" type="text" data-options="validType:'idcard'" value="{$vo.employe_identity_card}"/></td>
			<td>生日：</td>
			<td><input class="employe_brithday easyui-datebox" name="employe_brithday" type="text" value="{$vo.employe_brithday}"/></td>
		</tr>

		<tr>
			
			<td>婚姻状况：</td>
			<td>
				<select class="employe_if_marray" name="employe_if_marray">
					<option value="">--婚姻状况--</option>
					<option value="未婚">未婚</option>
					<option value="已婚">已婚</option>
					<option value="离异">离异</option>
					<option value="丧偶">丧偶</option>
				</select>
			</td>
			<td>民族：</td>
			<td><input class="employe_nation easyui-validatebox" name="employe_nation" type="text" data-options="validType:['length[0,30]']" value="{$vo.employe_nation}"/></td>
		</tr>

		<tr>
			
			<td>籍贯：</td>
			<td><input class="employe_native easyui-validatebox" name="employe_native" type="text" data-options="validType:['length[0,30]']" value="{$vo.employe_native}"/></td>
			<td>政治面貌：</td>
			<td>
				<select class="employe_politics" name="employe_politics">
					<option value="">--政治面貌--</option>
					<option value="共青团员">共青团员</option>
					<option value="预备党员">预备党员</option>
					<option value="党员">党员</option>
					<option value="民主党派">民主党派</option>
					<option value="群众">群众</option>
				</select>
			</td>
		</tr>

		<tr>
			
			<td>户口类别：</td>
			<td>
				<select class="employe_account_type" name="employe_account_type">
					<option value="">--户口类别--</option>
					<option value="本地城镇居民">本地城镇居民</option>
					<option value="外埠城镇居民">外埠城镇居民</option>
					<option value="本地农村户口">本地农村户口</option>
					<option value="外地农村户口">外地农村户口</option>
				</select>
			</td>
			<td>户口所在地：</td>
			<td><input class="employe_account_native easyui-validatebox" name="employe_account_native" type="text" data-options="validType:['length[0,200]']" value="{$vo.employe_account_native}"></td>
			<td align="center"><input id="url3" class="employe_photo" name="employe_photo" type="hidden" value="{$vo.employe_photo}"/> <input type="button" id="image3" value="上传照片" /></td>
		</tr>

		
	</table>

	<table>
		<tr>
			<td colspan="6" style="text-align: center; font-family: '黑体';">职位及联系方式</td>
		</tr>

		<tr>
			<td>部门：</td>
			<td>
				<select class="employe_department_id" name="employe_department_id">
					<option value="{$vo.employe_department_id}">..总经办</option>
					<option value="">--选择部门--</option>
					{$json}
				</select>
			</td>
			<td>职位：</td>
			<td>
				<select class="employe_position" name="employe_position">
					<option value="{$vo.employe_position}">|助理</option>
					<option value="">--职位--</option>
					<option value="1">|助理</option>
					<option value="2">|经理</option>
				</select>
			</td>
			<td>在职状态：</td>
			<td>
				<select class="employe_work_state" name="employe_work_state">
					<option value="">--在职状态--</option>
					<option value="在职">在职</option>
					<option value="离职">离职</option>
					<option value="离休">离休</option>
					<option value="退休">退休</option>
					<option value="借调">借调</option>
				</select>
			</td>
			
		</tr>

		<tr>
			<td>入职时间：</td>
			<td><input class="employe_hiredate easyui-datebox" name="employe_hiredate" type="text" value="{$vo.employe_hiredate}"/></td>
			<td>离职时间：</td>
			<td><input class="employe_departure_date easyui-datebox" name="employe_departure_date" type="text" value="{$vo.employe_departure_date}"/></td>
			<td>手机：</td>
			<td><input class="employe_phone easyui-validatebox" name="employe_phone" type="text" data-options="validType:['mobile']" value="{$vo.employe_phone}"/></td>
			
		</tr>

		<tr>
			<td>QQ：</td>
			<td><input class="employe_qq easyui-validatebox" name="employe_qq" type="text" data-options="validType:'QQ'" value="{$vo.employe_qq}"/></td>
			<td>邮箱：</td>
			<td><input class="employe_email easyui-validatebox" name="employe_email" type="text" data-options="validType:['email','length[0,20]']" value="{$vo.employe_email}"/></td>
			<td>家庭电话：</td>
			<td><input class="employe_family_phone easyui-validatebox" name="employe_family_phone" type="text" data-options="validType:['phone']" value="{$vo.employe_family_phone}"/></td>
			
		</tr>

		<tr>
			<td>家庭地址：</td>
			<td><input class="employe_family_address easyui-validatebox" name="employe_family_address"  type="text" data-options="validType:['length[0,200]']" value="{$vo.employe_family_address}"/></td>
		</tr>

		<tr>
			<td colspan="6" style="text-align: center;font-family: '黑体';">教育背景</td>
		</tr>

		<tr>
			<td>毕业学校：</td>
			<td><input class="employe_graduate_school easyui-validatebox" name="employe_graduate_school" type="text" data-options="validType:['length[0,100]']" value="{$vo.employe_graduate_school}"/></td>
			<td>毕业时间：</td>
			<td><input class="employe_graduate_time easyui-datebox" name="employe_graduate_time" type="text" value="{$vo.employe_graduate_time}"/></td>
			<td>学历：</td>
			<td>
				<select class="employe_degree" name="employe_degree">
					<option value="">--学历--</option>
					<option value="小学">小学</option>
					<option value="初中">初中</option>
					<option value="中专">中专</option>
					<option value="高中">高中</option>
					<option value="大专">大专</option>
					<option value="本科">本科</option>
					<option value="硕士">硕士</option>
					<option value="博士">博士</option>
				</select>
			</td>
		</tr>

		<tr>
			<td>专业：</td>
			<td><input class="employe_specialty easyui-validatebox" name="employe_specialty" type="text" data-options="validType:['length[0,50]']" value="{$vo.employe_specialty}"/></td>
		</tr>
		<tr>
			<td>社会关系：</td>
			<td colspan="5">
				<textarea class="employe_social_relations" name="employe_social_relations" style="width: 600px; height: 100px;">{$vo.employe_social_relations}</textarea>
			</td>
		</tr>
		
		<tr>
			<td>工作经历：</td>
			<td colspan="5">
				<textarea class="employe_work_exerience" name="employe_work_exerience" style="width: 600px; height: 100px;">{$vo.employe_work_exerience}</textarea>
			</td>
		</tr>
		<tr>
			<td>工作技能：</td>
			<td colspan="5">
				<textarea class="employe_work_skill" name="employe_work_skill" style="width: 600px; height: 100px;">{$vo.employe_work_skill}</textarea>
			</td>
		</tr>
		<tr>
			<td>备注：</td>
			<td colspan="5">
				<textarea class="employe_remark" name="employe_remark" style="width: 600px; height: 100px;">{$vo.employe_remark}</textarea>
			</td>
		</tr>
		<tr>
			<td>附件：</td>
			<td colspan="5">
				<input type="text" class="employe_file" name="employe_file" id="url" value="{$vo.employe_file}"/> <input type="button" id="insertfile" value="选择附件" />
			</td>
		</tr>
	</table>
	<div style="text-align: center; margin-top: 10px;">
		<input type="submit" value="提交"/>
	</div>
</div>
</volist>
</form>
</body>
</html>